function [x_idx, y_idx]=findIdx(x,y,triangleGrid)

x_idx=round((x-triangleGrid.minX)/triangleGrid.intervalX+1);
x_idx=max(1,min(triangleGrid.numX, x_idx));

y_idx=round((y-triangleGrid.minY)/triangleGrid.intervalY+1);
y_idx=max(1,min(triangleGrid.numY, y_idx));